@extends('layout')
@section('content')
<div class="getCouplet">
    分享对联
</div>
@foreach($couplets as $couplet)
@foreach($couplet as $key=>$value)
<h1>{{$value}}</h1>
<div class="shareCouplet" data-num="{{$key}}">赠送</div>
@endforeach
@endforeach
@endsection
@section('script')
<script>
    $('.shareCouplet').on('click',function(){
        var num = $(this).data('num');
        $.ajax({
            url:'/userShareCouplet',
            data:{'giveUser':123,'couplet_id':num},
            dataType:'JSON',
            type:'post',
            success:function(data){
                console.log(data);
            }
        });
    });
</script>
@endsection